package org.oos.dao.options;

import com.google.api.client.util.Key;

public class ScopeOptions extends OptionsMap {

	private static final long serialVersionUID = -3972605115783250597L;
	
	@Key("scope")
	private String scope;

	public void setScope(Scope scope) {
		if (scope != null) {
			this.scope = scope.toString().toLowerCase();
		}
	}

	public Scope getScope() {
		if (scope == null) {
			return null;
		} else {
			return Scope.valueOf(scope.toUpperCase());
		}
	}

	@Override
	public void clear() {
		scope = null;
	}

	public enum Scope {
		GLOBAL, USER, CONTACTS;
	}
}
